//
//  BindDeviceViewController.m
//  ForYourBeauty
//
//  Created by Kelly xu on 2019/5/27.
//  Copyright © 2019 changrenTech. All rights reserved.
//

#import "BindDeviceViewController.h"
#import "ScanCodeManager.h"
#import "ScanBindDeviceViewController.h"
#import "DeviceListViewController.h"
@interface BindDeviceViewController (){
    
}
@property(nonatomic,weak)IBOutlet UIImageView *inputTextBg;
@property(nonatomic,weak)IBOutlet UIImageView *contentImg;
@property(nonatomic,weak)IBOutlet UIButton *scanCodeBtn;
@property(nonatomic,weak)IBOutlet UIButton *searchDeviceBtn;
@end

@implementation BindDeviceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"绑定设备";
    [self setNavRightBtn:@"跳过" color:nil];
    [self configUI];
}
-(void)configUI{
    [self.inputTextBg setImage:[[UIImage imageNamed:@"cornerBg"] stretchableImageWithLeftCapWidth:[UIImage imageNamed:@"cornerBg"].size.width/2 topCapHeight:[UIImage imageNamed:@"cornerBg"].size.height/2]];
    self.scanCodeBtn.layer.cornerRadius = 20;
    self.searchDeviceBtn.layer.cornerRadius = 20;
}
-(IBAction)showScanCode:(id)sender{
    [[ScanCodeManager shardManager]showScanCode:^(NSString * _Nonnull sn) {
        ScanBindDeviceViewController *scanBindDevice = [[ScanBindDeviceViewController alloc]init];
        scanBindDevice.snCode = sn;
        [self.rt_navigationController pushViewController:scanBindDevice animated:YES complete:nil];
    } fail:^{
        [self.rt_navigationController popViewControllerAnimated:YES complete:nil];
    }];
}
-(IBAction)searchDevice:(id)sender{
    DeviceListViewController *wifiSetting = [[DeviceListViewController alloc]init];
    [self.rt_navigationController pushViewController:wifiSetting animated:YES complete:nil];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
